design of staircase calculation